<?php

/*
 * jzp2008
 */

namespace app\mall\controller;
use think\Db;

class Ad{    
    /*
     * 广告输出
     */
    public function index() {
                
        $input = request()->param();
        $board = filter($input['board'], 'app_index');
        $adsite = Db::name('ad_site')->getBySiteKey($board);
        $where = [
            'bg_date' => ['ELT', date('Y-m-d H:i:s')],
            'end_date' => ['EGT', date('Y-m-d H:i:s')],
            'site_id' => $adsite['site_id'],
        ];
        $ad = Db::name('ad')->where($where)->whereOr(['end_date'=>'NOT NULL'])->select();
        return $ad;
    }

}
